/*
 * Created by JFormDesigner on Thu Dec 23 11:41:56 CST 2021
 */

package com.cn.项目.飞机预约管理系统.UserFrame;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;

/**
 * @author Brainrain
 */
public class SelectStartEnd extends JFrame {
    public SelectStartEnd() {
        initComponents();
    }
    public static  String start = null;
    public static String endlocation = null;
    public static String date = null;
    public static String money = null;

    //出发地监听
    private void comboBox1ActionPerformed(ActionEvent e) {
        // TODO add your code here
        start = comboBox1.getSelectedItem().toString();
    }

    //目的地监听
    private void comboBox2ActionPerformed(ActionEvent e) {
        // TODO add your code here
        endlocation = comboBox2.getSelectedItem().toString();
    }

    //查询监听
    private void button1ActionPerformed(ActionEvent e) {
        // TODO add your code here
        money =textField1.getText();
         new ShowFilght01();
    }

    //日期监听
    private void comboBox3ActionPerformed(ActionEvent e) {
        // TODO add your code here
        date = comboBox3.getSelectedItem().toString();
    }


    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        label1 = new JLabel();
        label2 = new JLabel();
        label3 = new JLabel();
        comboBox1 = new JComboBox();
        comboBox2 = new JComboBox();
        button1 = new JButton();
        label4 = new JLabel();
        comboBox3 = new JComboBox();
        label5 = new JLabel();
        textField1 = new JTextField();

        //======== this ========
        setVisible(true);
        Container contentPane = getContentPane();
        contentPane.setLayout(null);

        //---- label1 ----
        label1.setText("\u9009\u62e9\u51fa\u53d1\u5730\u548c\u76ee\u7684\u5730");
        label1.setFont(label1.getFont().deriveFont(label1.getFont().getSize() + 10f));
        contentPane.add(label1);
        label1.setBounds(85, 10, 230, 40);

        //---- label2 ----
        label2.setText("\u51fa\u53d1\u5730\uff1a");
        label2.setFont(label2.getFont().deriveFont(label2.getFont().getSize() + 6f));
        contentPane.add(label2);
        label2.setBounds(20, 70, 80, 25);

        //---- label3 ----
        label3.setText("\u76ee\u7684\u5730\uff1a");
        label3.setFont(label3.getFont().deriveFont(label3.getFont().getSize() + 6f));
        contentPane.add(label3);
        label3.setBounds(20, 135, 80, 25);

        //---- comboBox1 ----
        comboBox1.addActionListener(e -> comboBox1ActionPerformed(e));
        contentPane.add(comboBox1);
        comboBox1.setBounds(130, 65, 155, 40);

        //---- comboBox2 ----
        comboBox2.addActionListener(e -> comboBox2ActionPerformed(e));
        contentPane.add(comboBox2);
        comboBox2.setBounds(130, 125, 155, 40);

        //---- button1 ----
        button1.setText("\u67e5\u8be2");
        button1.setFont(button1.getFont().deriveFont(button1.getFont().getSize() + 6f));
        button1.addActionListener(e -> button1ActionPerformed(e));
        contentPane.add(button1);
        button1.setBounds(135, 295, 110, 35);

        //---- label4 ----
        label4.setText("\u65e5\u671f\uff1a");
        label4.setFont(label4.getFont().deriveFont(label4.getFont().getSize() + 6f));
        contentPane.add(label4);
        label4.setBounds(20, 190, 80, 25);

        //---- comboBox3 ----
        comboBox3.addActionListener(e -> {
			comboBox2ActionPerformed(e);
			comboBox3ActionPerformed(e);
		});
        contentPane.add(comboBox3);
        comboBox3.setBounds(135, 185, 155, 40);

        //---- label5 ----
        label5.setText("\u4ef7\u683c\uff1a");
        label5.setFont(label5.getFont().deriveFont(label5.getFont().getSize() + 6f));
        contentPane.add(label5);
        label5.setBounds(20, 240, 80, 25);
        contentPane.add(textField1);
        textField1.setBounds(135, 240, 120, 35);

        contentPane.setPreferredSize(new Dimension(400, 375));
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
        comboBox1.addItem("上海");
        comboBox1.addItem("北京");
        comboBox1.addItem("广州");
        comboBox1.addItem("深圳");

        comboBox2.addItem("上海");
        comboBox2.addItem("洛杉矶");
        comboBox2.addItem("香港");
        comboBox2.addItem("濮阳");
        comboBox2.addItem("北京");
        comboBox2.addItem("澳门");

        comboBox3.addItem("2021-12-13");
        comboBox3.addItem("2021-12-14");
        comboBox3.addItem("2021-12-15");
        comboBox3.addItem("2021-12-16");
        comboBox3.addItem("2021-12-17");
        comboBox3.addItem("2021-12-18");
        comboBox3.addItem("2021-12-19");
        comboBox3.addItem("2021-12-20");
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    private JLabel label1;
    private JLabel label2;
    private JLabel label3;
    private JComboBox comboBox1;
    private JComboBox comboBox2;
    private JButton button1;
    private JLabel label4;
    private JComboBox comboBox3;
    private JLabel label5;
    private JTextField textField1;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}
